<template>
  <el-card class="box-card" style="line-height: 40px;height: 700px;overflow-y: auto">
    <el-table
      :data="Questions"
      stripe
      style="width: 100%">
      <el-table-column
        prop="q"
        label="问题"
        width="400">
      </el-table-column>
      <el-table-column
        label="操作"
        width="100">
        <template slot-scope="scope">
          <el-button @click="showAns(scope.row,scope.$index);" type="primary" size="small" :disabled="scope.row.clicked">查看</el-button>
        </template>
    </el-table-column>
    </el-table>
<!--    <a v-for="item in Questions" @click="showAns(item.a)">{{item.q}}<br></a>-->
  </el-card>
</template>

<script>
export default {
  name: "QuestionForm",
  props: {
    Questions: Array,
  },
  methods: {
    showAns(ans,index){
      // alert(ans.a)
      this.$set(this.Questions[index],'clicked',true)
      this.$store.commit("dialoguePush",ans)
    }
  }
}
</script>

<style scoped>

</style>
